package com.oig.oauth.api;


import com.oig.common.module.SysResponse;
import com.oig.oauth.api.factory.OauthFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;


@FeignClient(contextId = "oauthService", value = "sys-oauth-security", fallbackFactory = OauthFallbackFactory.class)
public interface OauthService {

    @RequestMapping(value = "/oauth2/token",method = {RequestMethod.POST}, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    Map<String,Object> token(@RequestParam MultiValueMap<String, Object> parameters);


    @RequestMapping(value = "/sso/logout")
    SysResponse<String> logout(@RequestParam("accessToken") String accessToken);
}
